/**
* All Rights Reserved , Copyright (C) 2022 , 青岛鼎信通讯股份有限公司
*
* MpmProjectExpertFullService
* 专家拜访要求数量
*
* 修改纪录
* 2022-12-06 版本：1.0 houyuhang 创建。
* @version 版本：1.0
* @author 作者：houyuhang
* 创建日期：2022-12-06
*/
package com.topscomm.mpm.service.impl;

import com.topscomm.mpm.pojo.MpmProjectExpertFullEntity;
import com.topscomm.pub.util.ConvertUtil;
import com.topscomm.pub.util.StringBufferProxy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.topscomm.mpm.service.IMpmProjectExpertFullService;
import com.topscomm.mpm.service.impl.auto.MpmProjectExpertFullServiceAuto;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

@Service(value = "mpmProjectExpertFullService")
@Scope(value = "singleton")
public class MpmProjectExpertFullService extends MpmProjectExpertFullServiceAuto implements IMpmProjectExpertFullService {
    /**
     * @author: houyuhang
     * @date: 2022/12/06
     * @description: 保存要求次数、条数
     * @modify:
     */
    @Transactional
    public void changeExpertNum(Map<String, Object> paraMap) {
        // 删除该项目原次数、条数记录
        StringBufferProxy sql = new StringBufferProxy();
        sql.appendSingle(" projectcode = '{0}' ", ConvertUtil.convertToString(paraMap.get("projectcode")));
        this.deleteByWhere(sql.toString());
        // 新增本次记录
        MpmProjectExpertFullEntity mpmProjectExpertFullEntity = new MpmProjectExpertFullEntity();
        mpmProjectExpertFullEntity.setProjectcode(ConvertUtil.convertToString(paraMap.get("projectcode")));
        mpmProjectExpertFullEntity.setVisitnum(ConvertUtil.convertToInt(paraMap.get("visitnum")));
        mpmProjectExpertFullEntity.setEnablevisitnum(ConvertUtil.convertToInt(paraMap.get("enablevisitnum")));
        this.insert(mpmProjectExpertFullEntity);
    }
}
